<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> - 反馈详情</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/Public/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/Public/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/Public/css/animate.css" rel="stylesheet">
    <link href="/Public/css/style.css?v=4.1.0" rel="stylesheet">
    <style>
        .project-people img {
            width: 100px;
            height: 100px;
        }

        .back_on_list {

            border: 1px solid #6254B2;
            padding: 2px;
            background-color: #6254B2;
            color: white;
            text-align: center;
            border-radius: 4px;
            margin: 10px;
        }
    </style>
    <style>
        .font {
            font-size: initial;
        }
    </style>
</head>

<body class="gray-bg">
<div class="row">
    <div class="col-sm-9">
        <div class="wrapper wrapper-content animated fadeInUp">
            <div class="ibox">
                <div class="ibox-content">
                    <div class="row m-t-sm">
                        <div class="col-sm-12 font">
                            <div class="pull-right tooltip-demo">
                                <if condition="$type2 eq ''">
                                    <a href="<{$SRVER_NAME}>/admin.php/ContactCenter/kf_user_list_feedback?feedback=<{$feedback}>&page=<{$page}>&status=<{$status}>&rid=<{$rid}>"
                                       class="btn btn-white btn-sm" data-toggle="tooltip" data-placement="top"
                                       title="返回"><i class="fa fa-reply"></i> 返回</a>
                                    <else/>
                                    <!--<a href="<{$SRVER_NAME}>/admin.php/UserCenter/communicate_record1?page1=<{$page}>&type=<{$type2}>&rid=<{$rid}>&user_content=<{$user_content}>&vid=<{$vid}>"-->
                                       <!--class="btn btn-white btn-sm" data-toggle="tooltip" data-placement="top"-->
                                       <!--title="返回"><i class="fa fa-reply"></i> 返回</a> -->
                                    <a href="javascript:window.history.go(-1);"
                                       class="btn btn-white btn-sm" data-toggle="tooltip" data-placement="top"
                                       title="返回"><i class="fa fa-reply"></i> 返回</a>
                                </if>
                            </div>
                            <div class="panel blank-panel">
                                <div class="panel-heading">
                                    <div class="panel-options">
                                        <ul class="nav nav-tabs">
                                            <li><a href="javascript:;" data-toggle="tab">反馈详情</a></li>
                                        </ul>
                                    </div>
                                </div>

                                <div class="panel-body">
                                    <div class="tab-content">
                                        <div class="tab-pane active" id="tab-1">
                                            <div class="feed-activity-list">
                                                <div class="feed-element">
                                                    <div class="media-body font">
                                                        用户<strong><a
                                                            href="<{$SRVER_NAME}>/admin.php/UserInfo/user_list_details?vid=<{$feedback_info.vid}>"><span
                                                            class="color_red"><{$name.truename}>[<{$name.mobile}>]</span></a></strong>
                                                        反馈详情
                                                        <if condition="$show eq '1'">

                                                            <a href="#" class="back_on_list"
                                                               onclick="call_phone()">外呼</a>

                                                        </if>
                                                        <br>
                                                        <small class="text-muted font"><{$feedback_info.ctime}></small>
                                                        <div class="well font" style="display: flex;flex-wrap: wrap">
                                                            <strong class="font">反馈内容：</strong>
                                                            <div class="font"><{$feedback_info.content}></div>
                                                        </div>
                                                        <div class="photos" style="display: flex">
                                                            <foreach name='imgs1' item='img'>
                                                                <div style="display: block;margin-bottom: 10px;"
                                                                     class="project-people">
                                                                    <a href="<{$img}>" class="img_link"
                                                                       data-rel="colorbox"> <img src="<{$img}>"
                                                                                                 height="142"
                                                                                                 width="196"/></a>
                                                                </div>&nbsp;
                                                            </foreach>
                                                        </div>
                                                    </div>
                                                </div>

                                                <volist name="list" id="vo">
                                                    <if condition="($vo['vid'] heq '0')">
                                                        <div class="feed-element">
                                                            <div class="media-body font">
                                                                客服<strong><{$vo.admin_name}></strong>受理:
                                                                <br>
                                                                <small class="text-muted font"><{$vo.ctime}></small>
                                                                <div class="well font"
                                                                     style="display: flex;flex-wrap: wrap">
                                                                    <strong>回复：</strong>
                                                                    <div class="font"><{$vo.content}></div>
                                                                </div>
                                                                <div class="photos" style="display: flex">
                                                                    <volist name="vo.img" id="vi" empty="">
                                                                        <div style="display: block;margin-bottom: 10px;"
                                                                             class="project-people">
                                                                            <a href="<{$vi}>" class="img_link"
                                                                               data-rel="colorbox"> <img src="<{$vi}>"
                                                                                                         height="142"
                                                                                                         width="196"/></a>
                                                                        </div>
                                                                    </volist>
                                                                </div>
                                                            </div>
                                                        </div>

                                                        <else/>

                                                        <div class="feed-element">
                                                            <div class="media-body font">
                                                                <strong>用户<a
                                                                        href="<{$SRVER_NAME}>/admin.php/UserInfo/user_list_details?vid=<{$feedback_info.vid}>"><span
                                                                        class="color_red"><{$name.truename}>[<{$name.mobile}>]</span></a></strong>
                                                                反馈详情
                                                                <br>
                                                                <small class="text-muted font"><{$vo.ctime}></small>
                                                                <div class="well font"
                                                                     style="display: flex;flex-wrap: wrap">
                                                                    <strong>回消息：</strong>
                                                                    <div class="font"><{$vo.content}></div>
                                                                </div>
                                                                <div class="photos" style="display: flex">
                                                                    <volist name="vo.img" id="vi" empty="">
                                                                        <div style="display: block;margin-bottom: 10px;"
                                                                             class="project-people">
                                                                            <a href="<{$vi}>" class="img_link"
                                                                               data-rel="colorbox"> <img src="<{$vi}>"
                                                                                                         height="142"
                                                                                                         width="196"/></a>
                                                                        </div>
                                                                    </volist>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </if>
                                                </volist>

                                            </div>

                                        </div>

                                    </div>

                                </div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <if condition="($feedback_info['status'] neq '3')">
        <div class="col-sm-3">
            <div class="wrapper wrapper-content project-manager">
                <h4>回复</h4>
                <p class="small font-bold">
                    <textarea style="width: 90%" class="input_bg_color" name="back_content" id="back_content" cols="70"
                              rows="12" placeholder="请输入回复内容"></textarea>
                </p>
                <p>
                    <label class="details_fileBox fl"><input type="file" name="uploadimg" id="uploadimg"
                                                             onchange="upload()">上传附件</label>
                <div class="clear"></div>

                <div>
                    <input id="title_img" type="hidden" name="title_img">
                    <!--<span class="help-block m-b-none">请上传图片大小为400*400px</span>-->

                    <div class="product_img" id="img">
                        <img src="/Public/admin/img/webuploader.png" style="height:100px;width: 100px">
                    </div>
                </div>
                </p>
                <div class="m-t-md">
                    <a href="javascript:;" onclick="back_feedback1()" class="btn btn-xs btn-primary">添加</a>
                </div>
            </div>
        </div>
    </if>
</div>

<script src="/Public/js/jquery.min.js?v=2.1.4"></script>
<script src="/Public/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/Public/js/content.js?v=1.0.0"></script>
<script src="/Public/admin/js/plugins/jquery.colorbox-min.js"></script>
<script src="/Public/admin/js/ajaxfileupload.js"></script>
<script src="/Public/admin/js/plugins/layer/layer.min.js"></script>
<script>
    jQuery(function ($) {
        colorbox_params = {
            reposition: true,
            scalePhotos: true,
            scrolling: false,
            previous: '<i class="fa fa-chevron-left"></i>',
            next: '<i class="fa fa-chevron-right"></i>',
            close: '&times;',
            current: '{current} of {total}',
            maxWidth: '80%',
            maxHeight: '80%',
            onOpen: function () {
                document.body.style.overflow = 'hidden';
            },
            onClosed: function () {
                document.body.style.overflow = 'auto';
            },
            onComplete: function () {
                $.colorbox.resize();
            }
        };
        $('.Info_style [data-rel="colorbox"]').colorbox(colorbox_params);
        $('.project-people [data-rel="colorbox"]').colorbox(colorbox_params);
        $("#cboxLoadingGraphic").append("<i class='icon-spinner orange'></i>");

    });

    $(document).ready(function () {

        $('#loading-example-btn').click(function () {
            btn = $(this);
            simpleLoad(btn, true)

            // Ajax example
            //                $.ajax().always(function () {
            //                    simpleLoad($(this), false)
            //                });

            simpleLoad(btn, false)
        });
    });

    function simpleLoad(btn, state) {
        if (state) {
            btn.children().addClass('fa-spin');
            btn.contents().last().replaceWith(" Loading");
        } else {
            setTimeout(function () {
                btn.children().removeClass('fa-spin');
                btn.contents().last().replaceWith(" Refresh");
            }, 2000);
        }
    }
    var urllist = "";//图片链接
    //回复反馈
    function back_feedback1() {

        //加载loading层
        var index = layer.load(1, {
            shade: [0.1, '#fff'] //0.1透明度的白色背景
        });
        var list = "<{$name.truename}>[<{$name.mobile}>]";
        var name = "<{$name.truename}>[<{$name.mobile}>]";
        var id = "<{$id}>";
        var url = "<{$SRVER_NAME}>/admin.php/UserFeedback/back_userFeedback";
        var tourl = "<{$SRVER_NAME}>/admin.php/UserFeedback/user_list_feedback";
        var content = $("#back_content").val();
        if (content == null || content == "") {
            layer.close(index);
            layer.alert("回复不能为空！\r\n", {
                title: '提示框',
                icon: 0,
            });
            return false;
        }
        
        layer.alert("确定回复", {title: '提示框', icon: 3}, function () {
            $.post(url, {id: id, name: name, back_content: content, img: urllist}, function (data) {
                if (data.code == "1001") {

                    var test = layer.alert(data.result, {title: '提示框', icon: 1}, function (index) {
                            window.location.reload();
                        }
                    );
                }
                else {
                    layer.alert(data.result, {title: '提示框', icon: 1});

                }
            });

        });
        layer.close(index);
    }

    //上传图片
    function upload() {
        var tourl = '<{$SRVER_NAME}>/admin.php/Knowledge/uploadimg';
        $.ajaxFileUpload({
            url: tourl,//需要链接到服务器地址
            secureuri: false,
            fileElementId: 'uploadimg',//文件选择框的id属性file的id
            dataType: 'json',
            success: function (data) {
                if (data.code == '1001') {
                    if (urllist != '') {
                        urllist = data.result + "," + urllist;
                    } else {
                        urllist = data.result;
                    }
                    var strs = urllist.split(","); //字符分割
                    $('#img').empty();
                    for (var i = 0; i < strs.length; i++) {
                        var html = '<img  style="width:150px" src="' + strs[i] + '" />';
                        $('#img').append(html);
                    }
                } else {
                    if (data.status == '0') {
                        layer.alert(data.info);
                    } else {
                        layer.alert(data.result);
                    }
                }
            }
        });
    }


    function call_phone() {
        var index = layer.load(1, {
            shade: [0.1, '#fff'] //0.1透明度的白色背景
        });
        var mobile = "<{$name.mobile}>";
        var url = "<{$SRVER_NAME}>/admin.php/AntiUser/call";

        layer.alert("确认外呼", {title: '提示框', icon: 3}, function (index) {
            $.post(url, {phone: mobile}, function (data) {
                console.log('1111111', data);
                layer.close(index);
            });
            layer.close(index);
        });
        layer.close(index);
    }
</script>


</body>

</html>
